<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .active {
            color: red;
        }
        .bolder {
            font-style: italic;
        }
    </style>
</head>
<body>
<div id="app">
    <!-- 第一种情况-->
    <h2 class="otherClass" :class="['active', 'bolder']">{{message}}</h2>
    <!-- 第二种情况-->
    <h2 class="otherClass" :class="[active, bolder]">{{message}}</h2>
    <!-- 第三种情况-->
    <h2 class="otherClass" :class="getClasses()">{{message}}</h2>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<script>
    const app = new Vue({
        el: '#app',
        data: {
            message: 'simplelu',
            active: 'active',
            bolder: 'bolder'
        },
        methods: {
            getClasses: function () {
                return [this.active, this.bolder]
            }
        }
    })
</script>
</body>
</html>